package cn.gene.timeyan.pojo.search.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

/**
 * 对应搜索的文档*
 *
 * @author LWG
 * @date 2022/7/21 21:40
 * @since 1.0.0@gene.cn
 */
@Data
@Document(indexName = "timeyan_share_index2")
@ApiModel(value="对应搜索的文档entity")
public class ShareForElasticAll implements Serializable {
    /*没有具体的表，选择相对应的表的字段*/
    @Id
    @ApiModelProperty(value="share id")
    private Long articleId;
    @Field(name="user_id")
    @ApiModelProperty(value = "发帖人")
    private Long userId;
    @Field(name="nickname")
    @ApiModelProperty(value = "昵称")
    private String nickname;
    @Field(name="avatar")
    @ApiModelProperty(value = "头像")
    private String avatar;
    /**
     * SPU名称
     */
    @Field(name = "article_title",type = FieldType.Text,
            analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    @ApiModelProperty(value="文章标题")
    private String articleTitle;
    @Field(name = "article_content",type = FieldType.Text,
            analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    @ApiModelProperty(value="文章正文")
    private String articleContent;

    @Field(name="module_id")
    @ApiModelProperty(value = "模块Id")
    private Long moduleId;

    /**
     * 鐘舵?(0灏佺?,1鏄剧ず)
     */
    @Field(name="article_state")
    @ApiModelProperty(value = "状态")
    private String articleState;

    /**
     * 鐐硅禐鏁
     */
    @Field(name="article_like")
    @ApiModelProperty(value = "点赞数")
    private Integer articleLike;

    /**
     * 鏀惰棌鏁
     */
    @Field(name="article_collection")
    @ApiModelProperty(value = "收藏数")
    private Integer articleCollection;

    /**
     * 娴忚?鏁
     */
    @Field(name="article_visit")
    @ApiModelProperty(value = "浏览数")
    private Integer articleVisit;

    /**
     * 璇勮?鏁
     */
    @Field(name="article_visit")
    @ApiModelProperty(value = "评论数")
    private Integer articleComment;

    /**
     * 杞?彂鏁
     */
    @Field(name="article_retweetedarticle_retweeted")
    @ApiModelProperty(value = "转发数")
    private Integer articleRetweetedarticleRetweeted;

    /**
     * 鍒涘缓鏃堕棿
     */
    @Field(name="create_time")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    /**
     * 淇?敼鏃堕棿
     */
    @Field(name="update_time")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;


}
